Uninitialized Constant By Password
Reported by rwl | September 6th, 2008 @ 07:27 PM
Hi there, sorry to post a ticket, but i have been unable to figure this one out.
No matter how i install restful auth, i run into this on production:
NameError (uninitialized constant Authentication::ByPassword::ModelClassMethods::REST_AUTH_SITE_KEY):
i have rails frozen to 2.1 and did the submodule clone from git hub.
Should i just try to clone it to the rails folder and delete the repo?
it works fine on dev.
thanks
Comments and changes to this ticket
-
MegaPrime September 26th, 2008 @ 03:14 AM
Hi,
I just hit this problem and after digging around I found out that the issue was a missing site_keys.rb file in my config/initializers/ folder.
For some reason it had been skipped by SVN (Netbeans) and wasn't uploaded.
Once I uploaded the file (it stores the REST_AUTH_SITE_KEY value) everything worked fine like it did in Dev.
hope this helps.
-
Attila Györffy October 21st, 2008 @ 10:22 AM
@MegaPrime: Thanks for your help, I had the same problem and your idea just worked.
-
macajueli January 26th, 2009 @ 07:33 AM
- Tag set to restful_authentication
I'm using herokugarden, I have the file mentioned above in my config/initializers folder but I still get the same error mentioned previously: NameError in MembersController#create
uninitialized constant Authentication::ByPassword::ModelClassMethods::REST_AUTH_SITE_KEY
below is the full trace:
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:275:in
load_missing_constant' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:467:in
const_missing' vendor/plugins/restful-authentication/lib/authentication/by_password.rb:31:inpassword_digest' vendor/plugins/restful-authentication/lib/authentication/by_password.rb:46:in
encrypt' vendor/plugins/restful-authentication/lib/authentication/by_password.rb:57:inencrypt_password' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:173:in
send' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:173:inevaluate_method' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:161:in
call' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:93:inrun' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:92:in
each' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:92:insend' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:92:in
run' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:272:inrun_callbacks' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/callbacks.rb:298:in
callback' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/callbacks.rb:206:increate_or_update' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:2200:in
save_without_validation' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/validations.rb:901:insave_without_dirty' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/dirty.rb:75:in
save_without_transactions' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/transactions.rb:106:insave' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in
transaction' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/transactions.rb:79:intransaction' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/transactions.rb:98:in
transaction' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/transactions.rb:106:insave' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/transactions.rb:118:in
rollback_active_record_state!' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/transactions.rb:106:insave' app/controllers/members_controller.rb:14:in
create' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:insend' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in
perform_action_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:incall_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in
perform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue_without_timeout' /usr/lib/ruby/1.8/benchmark.rb:293:in
measure' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue_without_timeout' /home/userapps_plugins/preload/request_timeout/lib/request_timeout.rb:9:in
perform_action_without_rescue' /usr/lib/ruby/1.8/timeout.rb:48:intimeout' /home/userapps_plugins/preload/request_timeout/lib/request_timeout.rb:8:in
perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:inperform_action_without_caching' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in
perform_action' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:incache' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in
cache' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:inperform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in
send' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:inprocess_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in
process_without_session_management_support' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:inprocess' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in
process' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:inhandle_request' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in
dispatch' /usr/lib/ruby/1.8/thread.rb:135:insynchronize' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in
dispatch' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:indispatch_cgi' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in
dispatch' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/rack/adapter/rails.rb:54:inserve_rails' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/rack/adapter/rails.rb:74:in
call' /home/heroku_rack/lib/toolbar.rb:15:incall' /home/heroku_rack/lib/static_assets.rb:9:in
call' /usr/lib/ruby/gems/1.8/gems/rack-0.4.0/lib/rack/urlmap.rb:42:incall' /usr/lib/ruby/gems/1.8/gems/rack-0.4.0/lib/rack/urlmap.rb:35:in
each' /usr/lib/ruby/gems/1.8/gems/rack-0.4.0/lib/rack/urlmap.rb:35:incall' /usr/lib/ruby/gems/1.8/gems/rack-0.4.0/lib/rack/builder.rb:53:in
call' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/connection.rb:59:inpre_process' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/connection.rb:50:in
process' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/connection.rb:35:inreceive_data' /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/eventmachine.rb:224:in
run_machine' /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/eventmachine.rb:224:inrun' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/backends/base.rb:45:in
start' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/server.rb:146:instart' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/controllers/controller.rb:79:in
start' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/runner.rb:166:insend' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/runner.rb:166:in
run_command' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/runner.rb:136:inrun!' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/bin/thin:6 /usr/bin/thin:19:in
load' /usr/bin/thin:19Request
Parameters:
{"commit"=>"Sign up", "authenticity_token"=>"29d79264559249bef2a6494af1f1d0e0fd07919d", "member"=>{"password_confirmation"=>"", "login"=>"joe123", "password"=>"", "email"=>"joe@blow.com"}}
-
macajueli January 26th, 2009 @ 08:40 AM
I put the two constants from site_keys.rb in the by_password.rb file and it works now as a temporary solution.
-
macajueli January 26th, 2009 @ 08:43 AM
that file can be found here for noobs like me: const_missing' vendor/plugins/restful-authentication/lib/authentication/by_password.rb:31:in password_digest'
-
Sergey Avseyev June 28th, 2009 @ 08:15 AM
- Assigned user cleared.
Simply preform
$ rake auth:gen:site_key
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Restful Authentication Generator
This widely-used plugin provides a foundation for securely managing user
authentication:
* Login / logout
* Secure password handling
* Account activation by validating email
* Account approval / disabling by admin
* Rudimentary hooks for authorization and access control.
http://github.com/technoweenie/restful-authentication/tree